'''
Descripttion: 
version: 
Author: dylan.Ding
Date: 2020-12-12 20:24:10
LastEditors: Please set LastEditors
LastEditTime: 2020-12-12 23:16:31
'''
#!/bin/env python
# coding:utf-8
#程序功能是为了完成判断文件中是否有重复句子
#并将重复句子打印出来

res_list = []
f = open('/home/dingqy/VVVBIOS/code/action.txt','r')
res_dup = []
index = 0
file_dul = open('/home/dingqy/VVVBIOS/code/r_d.txt', 'w')
file_last = open('/home/dingqy/VVVBIOS/code/r_nd.txt','w')
for line in f.readlines():
    index = index + 1
    if line in res_list:
        temp_str = ""
        #temp_str = temp_str + str(index) + ','    #要变为str才行
        temp_line = ''.join(line)
        temp_str = temp_str+temp_line
        #最终要变为str类型
        file_dul.write(temp_str);                  #将重复的存入到文件中
    else:
        res_list.append(line)
        file_last.write(line)

lists = [1, 2, 1, 1, 5]
lists.clear()
print(lists)
